package com.kaifamiao.bytestreams;

import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class PrintStreamTest {

    public static void main(String[] args) throws FileNotFoundException {

        PrintStream ps = new PrintStream( "numbers.txt" );

        NumberFormat nf = new DecimalFormat( "000" );

        for( int i = 1 ; i <= 110 ; i++ ){
            String s = nf.format( i );
            ps.println( s );
        }

        ps.close();

    }

}
